Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes wrapper implementation for file locking and adopts the new file locking method from NextcloudKit directly. The changes support different file lock types and improve the overall lock handling mechanism.
- Replaced old
setLockStateForFilewrapper with direct usage oflockUnlockFilefrom NextcloudKit - Added new lock-related properties (
lockToken,lockOwnerEditor, etc.) to data models and metadata structures - Introduced
SchemaVersionenum for cleaner database schema version management
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| FilesDatabaseManagerTests.swift | Updated schema version references to use new enum |
| MockRemoteItem.swift | Added new lock properties and updated NKFile conversion |
| MockRemoteInterface.swift | Replaced old lock method with new async throwing signature |
| TestableRemoteInterface.swift | Updated interface to match new lock method signature |
| SendableItemMetadata.swift | Added lockToken property to metadata structure |
| RealmItemMetadata.swift | Added lockToken property to Realm object |
| ItemMetadata.swift | Added lockToken property to protocol |
| FileProviderLogDetailKey.swift | Added lock key for logging NKLock objects |
| Item+LockFile.swift | Major refactor using new lock API with improved logging |
| RemoteInterface.swift | Updated protocol signature for lock operations |
| NextcloudKit+RemoteInterface.swift | Replaced wrapper with direct NextcloudKit call |
| NKFile+Extensions.swift | Updated to use NKLock object properties |
| SchemaVersion.swift | New enum for database schema version management |
| FilesDatabaseManager.swift | Updated to use SchemaVersion enum |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
98b8f5f to
aa3814e
Compare
camilasan
approved these changes
Sep 28, 2025
Collaborator
Author
|
With NextcloudKit 7.1.5, the upstream pull request is available which should resolve this compiler error. |
- Removed unnecessary wrapper implementation and use new file locking method from NextcloudKit directly. - Improved logging in Item+LockFile.swift based on recently introduced logging system. - Introduced new key to FileProviderLogDetailKey for NKLock objects. - Introduced SchemaVersion enum for cleaner references to Realm schema versions. - Introduced lockToken property to data models representing an item. Signed-off-by: Iva Horn <iva.horn@icloud.com>
aa3814e to
3298aa9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Required for: #124
Depends on: nextcloud/NextcloudKit#190 (CI actions will fail until this is available as a 7.x.x release which is referenced as a package dependency from this project)
files_lock documentation: https://github.com/nextcloud/files_lock?tab=readme-ov-file#api